project(demo)
#指定QT版本
set(QT_VERSION 6)
set(REQUIRED_LIBS Core Gui Widgets)
set(REQUIRED_LIBS_QUALIFIED Qt6::Core Qt6::Gui Qt6::Widgets)
# 开启QT用于预处理组件
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)

#添加头文件目录
include_directories(
        ${PROJECT_SOURCE_DIR}/frameless-window/src/include
        ${PROJECT_SOURCE_DIR}/frameless-window/src/headers
        ${PROJECT_SOURCE_DIR}/frameless-window/src/resources/forms
)
#添加源文件
add_executable(
        ${PROJECT_NAME} src/main.cpp src/mainwindow.cpp
        src/headers/mainwindow.h
)
#查找QT模块
find_package(Qt${QT_VERSION} COMPONENTS ${REQUIRED_LIBS} REQUIRED)
if (NOT CMAKE_PREFIX_PATH)
    message(WARNING "CMAKE_PREFIX_PATH is not defined, you may need to set it "
            "(-DCMAKE_PREFIX_PATH=\"path/to/Qt/lib/cmake\" or -DCMAKE_PREFIX_PATH=/usr/include/{host}/qt{version}/ on Ubuntu)")
endif ()
#添加模块
target_link_libraries(${PROJECT_NAME} ${REQUIRED_LIBS_QUALIFIED})